#coding=utf-8
import httplib

try:
    httpClient = httplib.HTTPConnection('www.baidu.com', 80, timeout = 10)
    httpClient.request('GET', '/')
    response = httpClient.getresponse()
    print response.status
    print response.reason
    print response.read()
except Exception, e:
    print e
finally:
    if httpClient:
        httpClient.close()

